<?php
    class Admin {
        // ATRIBUT
        public $database;
        public $session;

        // METHOD
        public function __construct($database,$session) {
            $this->database = $database;
            $this->session = $session;
        }

        // menggenerate header sesuai role
        public function genHeader() {
            if ($this->session->id_role==1) {
                include 'layout/general_layout/user_logged_header.php';
                include 'layout/general_layout/menu_admin.php';
            }
            else if ($this->session->id_role==2) {
                include 'layout/general_layout/user_logged_header.php';
                include 'layout/general_layout/menu_user.php';
            }
            else {
                include 'layout/general_layout/register_login_header.php';
                include 'layout/general_layout/description_bar.php';
            }
        }
    }
?>
